package com.example.project1;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;



import java.util.List;


public class weixin_lianxiren extends Fragment {

    private RecyclerView recyclerView1;
    private RecyclerAdapter recyclerAdapter1;
    private View view1;

    private List<Huoying> huoyingList1;
    //FragmentManager
    //private FragmentManager fragmentManager;

   // @Nullable

    public weixin_lianxiren() {
        // Required empty public constructor

    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view1 = inflater.inflate(R.layout.fragment_lianxiren, container, false);

        //initView1();
        //initData();
        // Inflate the layout for this fragment
        return view1 ;
    }

    private  void initView1(){


        recyclerView1 = view1.findViewById(R.id.rv_successive_dynasties_huoying);

        recyclerView1.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
////         //线性布局管理器
        LinearLayoutManager manager = new LinearLayoutManager(view1.getContext());
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        //LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
       //linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
//
//
        //recyclerView1.setLayoutManager(linearLayoutManager);
//        // 用于描述item的适配器
        recyclerAdapter1 = new RecyclerAdapter(huoyingList1);
        recyclerView1.setAdapter(recyclerAdapter1);

    }
    private void initData()
    {
        huoyingList1 = new ArrayList<>(7);
        huoyingList1.add(new Huoying(1, "千手柱间", "木遁"));
        huoyingList1.add(new Huoying(2, "千手扉间", "水遁"));
        huoyingList1.add(new Huoying(3, "猿飞日斩", "猿魔"));
        huoyingList1.add(new Huoying(4, "波风水门", "飞雷神"));
        huoyingList1.add(new Huoying(5, "千手纲手", "百豪之术"));
        huoyingList1.add(new Huoying(6, "旗木卡卡西", "雷切"));
        huoyingList1.add(new Huoying(7, "漩涡鸣人", "螺旋丸"));

    }
}